<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button onclick="send()">send server</button>
  <script src="./index.js"></script>
  <script>
    // 这种方式是频繁的使用.then，如果次数很多，也不是很友好
    function send() {
      myAjax('http://localhost:8001')
        .then(data => {
          return myAjax('http://localhost:8001/qingshu')
        })
        .then(data => {
          return myAjax('http://localhost:8001/songci')
        })
        .then(data => {
          console.log(data);
        })
        .catch(err => {

        })
    }
  </script>
</body>

</html>